<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>演示页面</title>
    <style>
        .border-div {
            border-color: gray;
            /*border-top-style: solid;*/
            /*border-top-width: thin;*/
            /*border-width: thin;*/
            /*border-style: solid;*/
            border-radius: 6px;
            margin-bottom: 40px;
            width: 50%;
        }

        .content-div {
            text-align: -webkit-center;
            margin-bottom: 20px;
        }

        h2 {
            background-color: gray;
            margin: 0;
        }
    </style>
    <script>
        function sso() {
          var ajax = new XMLHttpRequest();
          ajax.open('get', encodeURI("/sso"));
          ajax.send();
          ajax.onreadystatechange = function () {
            if (ajax.readyState == 4 && ajax.status == 200) {
              console.log(ajax.responseText);

              var res = JSON.parse(ajax.responseText);
              if (res.err == 0) {
                window.open(res.ssoUrl);
              } else {
                alert("sso出错啦！")
              }
            }
          }
        }

    </script>
</head>
<body>

<div align="center">

    <div>
        <h1 align="center"><p>演示页面</p></h1>
    </div>

    <div class="border-div">
        <div>
            <h2 align="center"><p>单点登录演示</p></h2>
            <h4><p></p></h4>
        </div>
        <div class="content-div">
            <table>
                <tr>
                    <td></td>
                    <td>
                        <button type="button" onclick="sso()">单点登录</button>
                    </td>
                </tr>
            </table>
        </div>
    </div>

</div>
</body>
</html>